package Pokerstats;

public class GenericData {
  private int id;

  public int getId() { return id; };
  public void setId(int id) { this.id = id; };

  public static class InvalidIdException extends Exception {
    static final long serialVersionUID = 0;
    InvalidIdException(String msg) { super(msg); }
  }

  public String toStringLong() {
    return "generic";
  }

  /**
   * Finds an occurence of a string from an array (wildcard notation: key*)
   * @param array
   * @param key
   * @return the key location or -1 if not found
   */
  public static int Find(String[] array, String key) {
    for (int i = 0; i < array.length; i++) {
      if(array[i].substring(0, key.length()).equals(key))
        return i;
    }
    return -1;
  }

}
